import 多渠道发送.SmsSendingStrategy;

/*将接口作为一个成员变量，因为有两个类(多渠道)实现了同一个接口*/
public class SmsSender {

    private SmsSendingStrategy strategy;

    public SmsSender() {
    }

    public SmsSender(SmsSendingStrategy strategy) {
        this.strategy = strategy;
    }

    public SmsSendingStrategy getStrategy() {
        return strategy;
    }

    public void setStrategy(SmsSendingStrategy strategy) {
        this.strategy = strategy;
    }

    /*发送短信*/
    public void sendSms(String phoneNumber,String message){
        strategy.sendSms(phoneNumber, message);
    }

}